﻿bob.ns.setNs('bob.array.extensions', {

    //v.2
    contains: function (array, item) {
        return bob.collections.extensions.contains.call(array, item);
    },

    //v.2
    remove: function (array, item, bNoError) {
        if (!bob.utils.isArray(array)) {
            throw new Error('Wrong argument: array.');
        }

        var index = bob.collections.extensions.indexOf.call(array, true, item);
        if (index >= 0) {
            array.splice(index, 1);
            return true;
        }

        if (!bNoError) {
            throw new Error(bob.string.formatString('Cannot find array element to remove: {0}.', item));
        }
        return false;
    }


});
